using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter03
{
	/// <summary>
	/// Example05: Taking a Hike
	/// A hiker begins a trip by first walking 25.0 km southeast 
	/// from her car. She stops and sets up her tent for the night. 
	/// On the second day, she walks 40.0 km in a direction 60.0^{\circle} 
	/// north of east, at which point she discovers a forest 
	/// ranger's tower.
	/// (A) Determine the components of the hiker's displacement 
	/// for each day.
	/// (B) Determine the components of the hiker's resultant 
	/// displacement R for the trip. Find an expression for R in 
	/// terms of unit vectors.
	/// </summary>
	public class Example05
	{
		public Example05()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Displacement d1 = new L.Displacement();
			d1.X = 25.0*Math.Cos(-45.0*Math.PI/180.0);
			d1.Y = 25.0*Math.Sin(-45.0*Math.PI/180.0);
			L.Displacement d2 = new L.Displacement();
			d2.X = 40.0*Math.Cos(60.0*Math.PI/180.0);
			d2.Y = 40.0*Math.Sin(60.0*Math.PI/180.0);
			L.Vector res = d1 + d2;
			result += Convert.ToString(res.X)+" ";
			result += Convert.ToString(res.Y)+" ";
			result += Convert.ToString(res.Z)+" ";
			result += Convert.ToString(res.Norm)+" ";
		}
	}
}
